import Vue from "vue";
import VueRouter from "../router";
import Store from "../store";

export default {
  mustbeLogin() {
    let token = localStorage.getItem("token");
    if (!token) {
      Vue.prototype.$toast("亲，请先登录，哈哈");
      setTimeout(() => {
        console.log(Store);
        Store["_mutations"]["isGoback/changeIsGoBack"][0](true)
        // Store
        VueRouter.push("/user");
      }, 1000);

      return false;
    }
    return true;
  },
};
